﻿#if TASKSUPPORT
using System.Threading.Tasks;
#else
using MugenMvvmToolkit.Models;
#endif
using MugenMvvmToolkit.Interfaces.Models;
using MugenMvvmToolkit.Interfaces.Views;

namespace MugenMvvmToolkit.Interfaces.ViewModels
{
    /// <summary>
    ///     Represents the base interface for window view model.
    /// </summary>
    public interface IWindowViewModelBase : IHasDisplayName, INotifyViewModelClosing, IHasOperationResult
    {
        /// <summary>
        ///     Gets a value that indicates whether the dialog is visible. true if the dialog is visible; otherwise, false.
        /// </summary>
        bool IsOpen { get; }

        /// <summary>
        ///     Gets the <see cref="IWindowViewBase" />.
        /// </summary>
        IWindowViewBase View { get; }
    }

    /// <summary>
    ///     Represents the base interface for window view model.
    /// </summary>
    public interface IWindowViewModel : IWindowViewModelBase
    {
#if TASKSUPPORT
        /// <summary>
        ///     Shows the current <see cref="IWindowViewModel" /> as a window.
        /// </summary>
        /// <param name="viewNameBinding">The specified name of view binding, if any.</param>        
        Task<bool> ShowAsync(string viewNameBinding = null);
#else
        /// <summary>
        ///     Shows the current <see cref="IWindowViewModel" /> as a window.
        /// </summary>
        /// <param name="viewNameBinding">The specified name of view binding, if any.</param>        
        IOperationResult<bool> ShowAsync(string viewNameBinding = null);
#endif
    }
}